package org.nudt.system.service

import org.nudt.common.model.PageData
import org.nudt.common.model.vo.PlayLogVO
import org.nudt.common.repository.PlayLogRepository
import org.springframework.data.domain.Pageable
import org.springframework.stereotype.Service

@Service
class PlayLogService(private val playLogRepository: PlayLogRepository) {
    
    fun getPLayLogByAppid(appid: String, pageable: Pageable): PageData<PlayLogVO> {
        val result = playLogRepository.getPlayLogListByAppid(appid, pageable)
        
        return PageData(result.number + 1, result.size, result.totalElements, result.content)
    }
    
    
    fun getPLayLog(pageable: Pageable): PageData<PlayLogVO> {
        val result = playLogRepository.getPlayLogList(pageable)
        
        return PageData(result.number + 1, result.size, result.totalElements, result.content)
    }
    
}